placeAssessment = {
	initPlaceAssessPage: function () {
		//绑定dom对象
		this.obj = {
			placeAssessmentResultTable: $("#placeAssessmentResultTable"), //地区考核统计
			placeNetworkTableTop: $("#placeNetworkTableTop"), //入网率统计
			recordNetworkTable: $("#recordNetworkTable"),
			resultOnlinTableTop: $("#resultOnlinTableTop"), //上线率--统计
			recordOnlinTable: $("#recordOnlinTable"), //上线率记录详情
			resultLineTableTop: $("#resultLineTableTop"), //轨迹完整率统计
			recordLineTable: $("#recordLineTable"), //轨迹完完整率详情统计
			resultWarnTableTop: $("#resultWarnTableTop"), //报警平均处理率统计
			recordWarnTable: $("#recordWarnTable"), //报警平均处理率详情
			resultDataTableTop: $("#resultDataTableTop"), //数据合格率统计
			recordDataTable: $("#recordDataTable"), //数据合格率统计详情
			searchText: $('#searchText')
		};
		//全局变量
		this.data = {
			datatable: [],
			tableParams: {
				areaId: '', //地区名称
				dateType: '3', //1, 日 2周 3月 4季 5年
				time: '', //结束时间
				page: 1,
				size: 10
			},
			tableRecordData: [], //记录表格数据
			menuIndex: 0, //切换菜单时的下标
			tableDom: '', //有分页表格的dom
			ajaxUrl: '', //请求路径
			topResultTableDom: '' ,//统计表格（上面的table）
			selectDate:[{ value:"d",name:"日"},{ value:"w",name:"周"},{ value:"m",name:"月"},{ value:"s",name:"季"},{ value:"y",name:"年"}]
		};
		this.loadFont();
		window.onresize = this.loadFont;
		this.init()
		this.bindEvent();
	},
	loadFont: function () {
		var widthScreen = $(window).width();
		var nowFont = widthScreen / 1920 * 15;
		var htmlFont = document.getElementsByTagName('html')[0];
		htmlFont.style.fontSize = nowFont + "px";
		htmlFont.style.lineHeight = nowFont + "px";
	},

	init: function () {
		let that = this;
		//初始化时间默认为上个月
		var now = new Date();
		let curYear = now.getFullYear();
		let curMonth = now.getMonth() + 1;
		let curDate = now.getDate();
		let maxCurMonth = curMonth - 1 >= 10 ? curMonth - 1 : `0${curMonth - 1}`;
		let curTime = `${curYear}-${maxCurMonth}-01`;
		console.log(curTime, "ccccccccc")
		that.data.tableParams.time = curTime;
		this.menuSwitch(0);
		this.diquSelceted();
		lay('#version').html('-v' + laydate.v);
		$Date = laydate;
		that.creatId("#selectedOption",that.data.selectDate);
		that.initDateForm();
	},
	bindEvent: function () {
		let that = this;
		//重置
		$("#resetClick").click(() => {
			lay('#version').html('-v' + laydate.v);
			$("#selectedOption").val('m');
			var index = $("#selectedOption").find("option:selected").val();
			console.log(index, "重置的时候")
			if (index == "w") {
				$("#d121").show();
				$("#worldId").hide();
			} else {
				$("#worldId").show();
				$("#d121").hide();
			}

			//初始化时间默认为上个月
			var now = new Date();
			let curYear = now.getFullYear();
			let curMonth = now.getMonth() + 1;
			let curDate = now.getDate();
			let maxCurMonth = curMonth - 1 >= 10 ? curMonth - 1 : `0${curMonth - 1}`;
			let curTime = `${curYear}-${maxCurMonth}-01`;
			console.log(curTime, "ccccccccc")
			that.data.tableParams.time = curTime;
			$Date = laydate;
			that.initDateForm();
			$('#area').val('');
			$('#area').attr('data-id', "");
			that.data.tableParams.areaId = '';
			//重置分页
			that.data.tableParams.page = 1;
			let modelIndex = that.data.menuIndex;
			that.menuSwitch(modelIndex);
		})
		//查询
		$("#check").click(() => {
			let areacode = $('#area').attr("data-id");
			if (areacode !== undefined) {
				that.data.tableParams.areaId = areacode;
			}
			let modelIndex = that.data.menuIndex;
			that.menuSwitch(modelIndex);
		})
		//头部菜单切换

		$("#selectedOption").siblings("input").val("月");
		$("#selectedOption").val('m');
		that.initDateForm();
		$("#jtab").off('click','ul li').on('click','ul li',function(e) {
			let index = $(this).index();
			that.data.menuIndex = index;
			$(this).addClass("active").siblings("li").removeClass("active");
			$('.j-search-con .search-div .out-table .j-table').eq(index).show().siblings(".j-table").hide();
			lay('#version').html('-v' + laydate.v);
			$("#selectedOption").val('m');
			var indexSelect = $("#selectedOption").find("option:selected").val();
			console.log(index, "重置的时候")
			if (indexSelect == "w") {
				$("#d121").show();
				$("#worldId").hide();
			} else {
				$("#worldId").show();
				$("#d121").hide();
			}
			//初始化时间默认为上个月
			var now = new Date();
			let curYear = now.getFullYear();
			let curMonth = now.getMonth() + 1;
			let curDate = now.getDate();
			let maxCurMonth = curMonth - 1 >= 10 ? curMonth - 1 : `0${curMonth - 1}`;
			let curTime = `${curYear}-${maxCurMonth}-01`;
			$("#selectedOption").siblings("input").val("月");
			console.log(curTime, "ccccccccc")
			that.data.tableParams.time = curTime;
			$Date = laydate;
			that.initDateForm();
			$('#area').attr("data-id", "");
			that.data.tableParams.areaId = '';
			$('#area').val('');
			that.data.tableParams.page = 1;
			that.data.tableParams.dateType = '3';
			that.menuSwitch(index);
			e.stopPropagation();
			creatOption()
		})
		//日期插件下拉选择
		function creatOption() {
			$("#selectedOption").change(function () {
				var index = $(this).find("option:selected").val();
				var indexType = $(this).get(0).selectedIndex + 1;
				that.data.tableParams.dateType = indexType;
				console.log(that.data.tableParams.dateType, "选择日期类型");
				if (index == "w") {
					$("#d121").show();
					$("#worldId").hide();
				} else {
					$("#worldId").show();
					$("#worldId").val("");
					$("#d121").hide();
				}
			})
		}
		creatOption()
	},
	/**
	 *下拉
	 */
	creatId:function(id,optionArr){
		$(id).html();
		var str="";
		$.each(optionArr,function (k,v) {
			if(k.value == "m"){
				str+=`<option "selected" value=${v.value}>${v.name}</option>`;
			}else{
				str+=`<option value=${v.value}>${v.name}</option>`;
			}
		});
		$(id).html(str);
		$(id).comboSelect();
  },
	/**
	 * 请求地区数据
	 * */
	diquSelceted: function () {
		var self = this;
		var mapurl = HTTP + urls.diquSelceted;
		$.ajax({
			headers: {
				authorization: window.localStorage.getItem("auth_token") || ""
			},
			contentType: "application/json;charset=utf-8",
			dataType: "json",
			url: mapurl,
			type: "get",
			success: function (data) {
				data[0].code = 1;
				$.each(data[0].cityAreaVOS, function (i, dom) {
					data[0].cityAreaVOS[i].code = 2;
					$.each(data[0].cityAreaVOS[i].cityAreaVOS, function (j, dom) {
						data[0].cityAreaVOS[i].cityAreaVOS[j].code = 3;
					})
				})
				self.creatMainRido("qrm-main", data, "cityAreaVOS", "code");
			}
		});

	},
	/**
	 * 下拉框
	 * */
	creatMainRido: function (id, attr, child, jibie) {
		$(id).html("");
		var sttrdiv = "";
		for (var i = 0; i < 3; i++) {
			sttrdiv += "<div class='qrm-border" + (i + 1) + "' style='display:none'>" +
				"<ul class='qrm-lev-" + (i + 1) + " qrm-lev' id='qrm-border1'>" +
				"</ul>" +
				"</div>"
		};
		$(".qrm-main").html(sttrdiv);
		var str = "";
		$("#qrm-border1").html("");
		var forTree = function (o) {
			for (var i = 0; i < o.length; i++) {
				var urlstr = "";
				try {
					urlstr = "<li><span data-id='" + o[i]["id"] + "'>" + o[i]["name"] + "</span><i class='qrm-arrow-right'></i><ul class='li-zi-" + o[i][jibie] + "' style='display: none'>";
					str += urlstr;
					if (o[i][child] != null) {
						forTree(o[i][child]);
					}
					str += "</ul>";
				} catch (e) { }
			}
			return str;
		};
		$("#qrm-border1").html(forTree(attr));
	},
	/**
	 * 切换选项卡
	 * */
	menuSwitch: function (indexNum) {
		switch (indexNum) {
			//地区考核统计
			case 0:
				this.data.tableDom = "#placeAssessmentResultTable";
				this.data.ajaxUrl = "/api/vehicle/areaStatistics";
				this.getTableList("/api/vehicle/areaStatistics", this.data.tableParams, this.obj.placeAssessmentResultTable, indexNum);
				break;
			//入网率统计
			case 1:
				this.data.topResultTableDom = "#placeNetworkTableTop";
				this.data.tableDom = "#recordNetworkTable";
				this.data.ajaxUrl = "/api/vehicle/areaNetworkStatistics";
				this.getTopTableList("/api/vehicle/areaNetworkStatistics", this.data.tableParams, this.obj.placeNetworkTableTop, indexNum);
				this.getTableList("/api/vehicle/areaNetworkStatistics", this.data.tableParams, this.obj.recordNetworkTable, indexNum);
				break;
			//上线率统计
			case 2:
				this.data.topResultTableDom = "#resultOnlinTableTop";
				this.data.tableDom = "#recordOnlinTable";
				this.data.ajaxUrl = "/api/vehicle/areaOnlineStatistics";
				this.getTopTableList("/api/vehicle/areaOnlineStatistics", this.data.tableParams, this.obj.resultOnlinTableTop, indexNum);
				this.getTableList("/api/vehicle/areaOnlineStatistics", this.data.tableParams, this.obj.recordOnlinTable, indexNum);
				break;
			//轨迹完整率统计
			case 3:
				this.data.topResultTableDom = "#resultLineTableTop";
				this.data.tableDom = "#recordLineTable";
				this.data.ajaxUrl = "/api/vehicle/areaFootprintStatistics";
				this.getTopTableList("/api/vehicle/areaFootprintStatistics", this.data.tableParams, this.obj.resultLineTableTop, indexNum);
				this.getTableList("/api/vehicle/areaFootprintStatistics", this.data.tableParams, this.obj.recordLineTable, indexNum);
				break;
			//报警平均处理率
			case 4:
				this.data.topResultTableDom = "#resultWarnTableTop";
				this.data.tableDom = "#recordWarnTable";
				this.data.ajaxUrl = "/api/vehicle/areaAlarmHandleStatistics";
				this.getTopTableList("/api/vehicle/areaAlarmHandleStatistics", this.data.tableParams, this.obj.resultWarnTableTop, indexNum);
				this.getTableList("/api/vehicle/areaAlarmHandleStatistics", this.data.tableParams, this.obj.recordWarnTable, indexNum);
				break;
			//数据合格率统计
			case 5:
				this.data.topResultTableDom = "#resultDataTableTop";
				this.data.tableDom = "#recordDataTable";
				this.data.ajaxUrl = "/api/vehicle/areaAlarmQualifiedStatistics";
				this.getTopTableList("/api/vehicle/areaAlarmQualifiedStatistics", this.data.tableParams, this.obj.resultDataTableTop, indexNum);
				this.getTableList("/api/vehicle/areaAlarmQualifiedStatistics", this.data.tableParams, this.obj.recordDataTable, indexNum);
				break;
			default:
				this.data.tableDom = "#placeAssessmentResultTable";
				this.data.ajaxUrl = "/api/vehicle/areaStatistics";
				this.getTableList("/api/vehicle/areaStatistics", this.data.tableParams, this.obj.placeAssessmentResultTable, indexNum);
		}
	},
	/**
	 * 请求记录车辆详情接口数据
	 * */
	getTableList(url, pramsData, dom, indexNum) {
		$("#jid_loading").show()
		let self = this;
		jrequest.get(url, pramsData).then(res => {
			let recordMock = [];
			let totalpage = 0;
			if (res.data !== null && res.data.length !== 0) {
				if (indexNum === 0) {
					recordMock = res.data;
					totalpage = res.total;
				} else {
					let {
						data: {
							data: {
								records
							}
						}
					} = res;
					recordMock = records;
					totalpage = res.data.data.total;
				}
			} else {
				recordMock = res.data;
			}
			//清空地区
			this.creatTable(dom, recordMock, indexNum, totalpage);

			$("#jid_loading").hide()
		})
	},
	/**
	 * 请求无分页表格
	 * */
	getTopTableList(url, pramsData, dom, indexNum) {
		jrequest.get(url, pramsData).then(res => {
			let TopTabledata = []; //统计表格（上面表格）
			delete res.data.data;
			let resultmock = res.data; //删除记录后的值剩余总数统计的值
			TopTabledata.push(resultmock)
			this.creatTopReseultTable(dom, TopTabledata, indexNum);
		})
	},
	/**
	 * 创建记录table
	 * */
	creatTable: function (dom, recordMock, indexNum, totalpage) {
		var self = this;
		var columnsData = ''; //不同表格的表头
		let columnsDataArr = [
			//地区考核记录
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					var pageSize=self.data.tableParams.size;
					var pageNumber=self.data.tableParams.page;
					return pageSize * (pageNumber - 1) + index + 1;
				}
			},
			{
				field: "areaName",
				title: "地区名称",
				visible: true
			},
			{
				field: "networkLv",
				title: "入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLvScore",
				title: "入网率得分",
				visible: false
			},
			{
				field: "onlineLv",
				title: "上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "onlineLvScore",
				title: "上线率得分",
				visible: false
			},
			{
				field: "footprintLv",
				title: "轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "footprintLvScore",
				title: "轨迹完整率得分",
				visible: false
			},
			{
				field: "alarmHandleLv",
				title: "报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "alarmHandleLvScore",
				title: "报警平均处理率得分",
				visible: false
			},
			{
				field: "dataQualifiedLvScore",
				title: "数据合格率得分",
				visible: false
			},
			{
				field: "dataQualifiedLv",
				title: "数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "totalScore",
				title: "总考核得分",
				visible: true
			}
			],
			//入网率统计记录
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					var pageSize=self.data.tableParams.size;
					var pageNumber=self.data.tableParams.page;
					return pageSize * (pageNumber - 1) + index + 1;
				}
			},
			{
				field: "areaName",
				title: "地区",
				visible: true
			},
			{
				field: "netCarLv",
				title: "班线客运入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			//上线率统计记录
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					var pageSize=self.data.tableParams.size;
					var pageNumber=self.data.tableParams.page;
					return pageSize * (pageNumber - 1) + index + 1;
				}
			},
			{
				field: "areaName",
				title: "地区",
				visible: true
			},
			{
				field: "netCarLv",
				title: "班线客运上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			//轨迹完整率统计记录
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					var pageSize=self.data.tableParams.size;
					var pageNumber=self.data.tableParams.page;
					return pageSize * (pageNumber - 1) + index + 1;
				}
			},
			{
				field: "areaName",
				title: "地区",
				visible: true
			},
			{
				field: "netCarLv",
				title: "班线客运轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			//报警平均处理率记录
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					var pageSize=self.data.tableParams.size;
					var pageNumber=self.data.tableParams.page;
					return pageSize * (pageNumber - 1) + index + 1;
				}
			},
			{
				field: "areaName",
				title: "地区",
				visible: true
			},
			{
				field: "netCarLv",
				title: "班线客运报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			//数据合格率统计记录
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					var pageSize=self.data.tableParams.size;
					var pageNumber=self.data.tableParams.page;
					return pageSize * (pageNumber - 1) + index + 1;
				}
			},
			{
				field: "areaName",
				title: "地区",
				visible: true
			},
			{
				field: "netCarLv",
				title: "班线客运数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			]
		];
		columnsData = columnsDataArr[indexNum];
		self.tableEvent(dom, recordMock, columnsData, true, totalpage);
	},
	/**
	 * 创建无分页table
	 * */
	creatTopReseultTable: function (dom, TopTabledata, indexNum) {
		var self = this;
		var columnsNetworkResultArr = [
			[],
			// 入网率统计
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					return index + 1;
				}
			},
			{
				field: "netCarLv",
				title: "班线客运入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总入网率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			// 上线率统计
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					return index + 1;
				}
			},
			{
				field: "netCarLv",
				title: "班线客运上线率",
				visible: true, formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总上线率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			// 轨迹完整率统计
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					return index + 1;
				}
			},
			{
				field: "netCarLv",
				title: "班线客运轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总轨迹完整率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			//报警平均处理率
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					return index + 1;
				}
			},
			{
				field: "netCarLv",
				title: "班线客运报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总报警平均处理率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			],
			//数据合格率统计
			[{
				field: 'no',
				title: '序号',
				align: 'left',
				formatter: function (value, row, index) {
					return index + 1;
				}
			},
			{
				field: "netCarLv",
				title: "班线客运数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netTransLv",
				title: "旅游包车数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "netDangerLv",
				title: "危险品运输数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "networkLv",
				title: "总数据合格率",
				visible: true,
				formatter: function (value, row, index) {
					return `${value}%`;
				}
			},
			{
				field: "linkRelative",
				title: "环比",
				visible: true,
				formatter: function (value, row, index) {
					row.compareNum = value;
					if (value == 0) {
						return `-`;
					} else if (value == 9999) {
						return ``;
					} else {
						return `${value}%`;
					}
				},
				cellStyle: function (value, row, index) {
					console.log(row.compareNum, "测试测试测试")
					console.log(row, "测试测试测试")
					let valRow = row.compareNum;
					if (index % 2 == 0) {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow == 9999) {
							return { css: { "background": "url('img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else {
							return {}
						}
					} else {
						if (valRow > 0 && valRow < 9999) {
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if (valRow < 0) {
							return { css: { "background": "#042b3e url('img/arrow-bot.png') no-repeat 60% center", "background-size": "5px 15px" } }
						} else if(valRow == 9999){
							return { css: { "background": "#042b3e url('../img/arrow-top.png') no-repeat 60% center", "background-size": "5px 15px" } }
						}else {
							return {}
						}
					}
				}
			}
			]
		];
		var columnsTopData = ''; //不同表格的表头
		columnsTopData = columnsNetworkResultArr[indexNum];
		self.resultTopTable(dom, TopTabledata, columnsTopData, false);
	},
	/**
	 * 创建记录表格
	 * */
	tableEvent: function (tabledom, data, columns, paginationShow, total) {
		let that = this
		$(tabledom).bootstrapTable("destroy");
		$(tabledom).bootstrapTable({
			method: 'get',
			cache: false,
			height: 430,
			pagination: paginationShow,
			pageSize: 10,
			pageNumber: that.data.tableParams.page,
			showColumns: true,
			striped: true,
			columns: columns,
			sidePagination: 'server', // client or server
			totalRows: total,
			data: data,
			onPageChange: function (size, number) {
				console.log(number)
				that.data.tableParams.page = number;
				that.getTableCutpge(that.data.ajaxUrl, that.data.tableParams, that.data.tableDom, that.data.menuIndex)
			},
			formatNoMatches: function () {
				return '暂无数据';
			}
		});
	},
	/**
	 * 分页更新数据
	 * */
	getTableCutpge(url, pramsData, dom, indexNum) {
		let self = this;
		jrequest.get(url, pramsData).then(res => {
			let recordMock = [];
			let totalpage = '';
			if (indexNum === 0) {
				recordMock = res.data;
				totalpage = res.data.total;
			} else {
				let {
					data: {
						data: {
							records
						}
					}
				} = res;
				recordMock = records;
				totalpage = res.data.data.total;
			}
			$(dom).bootstrapTable("load", recordMock)
		})
	},
	/**
	 * 统计表格（上面）
	 * */
	resultTopTable: function (tabledom, data, columns, paginationShow) {
		let that = this
		$(tabledom).bootstrapTable("destroy");
		$(tabledom).bootstrapTable({
			method: 'get',
			cache: false,
			height: 430,
			pagination: paginationShow,
			showColumns: false,
			striped: true,
			columns: columns,
			data: data,
			formatNoMatches: function () {
				return '暂无数据';
			}
		});
	},
	//--------------------------------------------日期插件------------------------------------------//
	/**
			 * 季度初始化
			 * @param ohd 季度input dom对象非jquery对象
			 * @param sgl 有值单个，无值默认范围
			 */
	renderSeasonDate: function (ohd, sgl) {
		let self = this;
		var ele = $(ohd);
		console.log(ohd, sgl, "季度")
		var now = new Date();
		let curYear = now.getFullYear();
		let curMonth = now.getMonth() + 1;
		let curDate = now.getDate();
		let maxMonthAuton;
		if (curMonth >= 1 && curMonth <= 3) {
			maxMonthAuton = '00';
		} else if (curMonth >= 4 && curMonth <= 6) {
			maxMonthAuton = '01';
		} else if (curMonth >= 7 && curMonth <= 9) {
			maxMonthAuton = '02';
		} else {
			maxMonthAuton = '03';
		}
		$Date.render({
			elem: ohd,
			type: 'month',
			format: 'yyyy年M季度',
			min: "1900-1-1",
			max: `${curYear}-${maxMonthAuton}-${curDate}`,
			btns: ['clear', 'confirm'],
			ready: function (value, date, endDate) {
				console.log(value, date, endDate, "季度获取的值")
				var hd = $("#layui-laydate" + ele.attr("lay-key"));
				if (hd.length > 0) {
					hd.click(function () {
						ren($(this));
					});
				}
				ren(hd);
			},
			done: function (value, date) {
				console.log(value, date, "季度")
				let realMonth;
				if (date.month == "04") {
					realMonth = '10';
				} else if (date.month == "03") {
					realMonth = '07';
				} else if (date.month == "02") {
					realMonth = '04';
				} else {
					realMonth = '01';
				}
				let time = `${date.year}-${realMonth}-${date.date}`;
				console.log(time, "ttttttttttttttttttt");
				self.data.tableParams.time = time;
				console.log(self.data.tableParams.time, "季度赋值");
			}
		});
		var ren = function (thiz) {
			var mls = thiz.find(".laydate-month-list");
			mls.each(function (i, e) {
				$(this).find("li").each(function (inx, ele) {
					var cx = ele.innerHTML;
					if (inx < 4) {
						ele.innerHTML = cx.replace(/月/g, "季度");
					} else {
						ele.style.display = "none";
					}
				});
			});
		}
	},
	/**
	 * 初始化表单中年季月日范围选择
	 * 下拉框与日期框对应：
	 *  <select class="dateSelector" date-target="PI" ...
	 *  <input type="text" class="dateTargetPI" readonly ...
	 *  PI为自定义的对应关键字
	 *
	 * @param form 要渲染的form的jquery对象，当form为空默认值为全页面
	 * @param sgl 有值单个，无值默认范围
	 */
	initDateForm: function (sgl, form) {
		let self = this;
		var now = new Date();
		let curYear = now.getFullYear();
		let curMonth = (now.getMonth() + 1) >= 10 ? now.getMonth() + 1 : `0${now.getMonth() + 1}`;
		let curDate = now.getDate();
		console.log(curYear, curMonth, curDate, "多去当前年月日")
		let curTime = `${curYear}-${curMonth}-${curDate}`;
		console.log(curTime, "当前年月日")
		let maxCurYear = curYear - 1;
		let maxCurMonth = (curMonth - 1) >= 10 ? curMonth - 1 : `0${curMonth - 1}`;
		let maxCurDate = curDate - 1;
		if (this.isNull(form)) form = $(document.body);
		var ltm = function (tar, tars, tva) {
			console.log(tar, tars, tva, "ttttttttttttt")
			tars.each(function () {
				$(this).removeAttr("lay-key");
				this.outerHTML = this.outerHTML;
			});
			tars = form.find(".dateTarget" + tar);
			tars.each(function () {
				var ele = $(this);
				if ("y" == tva) {
					let maxYearValue = `${maxCurYear}-${curMonth}-${curDate}`;
					$Date.render({
						elem: this,
						type: 'year',
						format: 'yyyy年',
						max: maxYearValue,
						done: function (value, date) {
							console.log(value, date, "年");
							let time = `${date.year}-01-01`;
							console.log(time, "ttttttttttttttttttt");
							self.data.tableParams.time = time;
							console.log(self.data.tableParams.time, "月份赋值");
						}
					});
				} else if ("s" == tva) {
					self.renderSeasonDate(this, 1);
				} else if ("m" == tva) {
					let maxMonthValue = `${curYear}-${maxCurMonth}-${curDate}`;
					$Date.render({
						elem: this,
						type: 'month',
						format: 'yyyy年MM月',
						max: maxMonthValue,
						value: `${curYear}年${maxCurMonth}月`,
						done: function (value, date) {
							console.log(value, date, "月")
							let monthStr = date.month >= 10 ? date.month : `0${date.month}`;
							let time = `${date.year}-${monthStr}-01`;
							console.log(time, "ttttttttttttttttttt");
							self.data.tableParams.time = time;
							console.log(self.data.tableParams.time, "月份赋值")
						}
					});
				} else if ("d" == tva) {
					let maxDateValue = `${curYear}-${curMonth}-${maxCurDate}`;
					$Date.render({
						elem: this,
						format: 'yyyy年MM月dd日',
						max: maxDateValue,
						done: function (value, date) {
							console.log(value, date, "日");
							let monthStr = date.month >= 10 ? date.month : `0${date.month}`;
							let dateStr = date.date >= 10 ? date.date : `0${date.date}`;
							let time = `${date.year}-${monthStr}-${dateStr}`;
							console.log(time, "ttttttttttttttttttt");
							self.data.tableParams.time = time;
							console.log(self.data.tableParams.time, "月份赋值")
						}
					});
				}
			});
		}
		var sels = form.find(".dateSelector");
		sels.each(function (i, e) {
			var ths = this;
			var thiz = $(e);
			var tar = thiz.attr("date-target");
			thiz.next().find("dd").click(function () {
				var tva = thiz.val();
				var tars = form.find(".dateTarget" + tar);
				ltm(tar, tars, tva);
			});
			thiz.change(function () {
				var tva = $(this).val();
				var tars = form.find(".dateTarget" + tar);
				ltm(tar, tars, tva);
			});
			var tars = form.find(".dateTarget" + tar);
			ltm(tar, tars, thiz.val());
		});
	},

	isNull: function (s) {
		if (s == null || typeof (s) == "undefined" || s == "") return true;
		return false;
	},
	week: function () {
		this.data.tableParams.time = $dp.$('d121').value;
		$dp.$('d121').value = $dp.cal.getP('y') + "年" + $dp.cal.getP('W', 'WW') + "周";
	}

}
$(function () {
	placeAssessment.initPlaceAssessPage();
})
